<!DOCTYPE html>
<html>
<head>
    <title></title>
    <#include "/header.html"/>
    <link rel="stylesheet" href="${request.contextPath}/statics/plugins/bootstrapValidator/css/bootstrapValidator.min.css">
    <script src="${request.contextPath}/statics/plugins/bootstrapValidator/js/bootstrapValidator.min.js"></script>
    <style type="text/css">
        html{
            overflow-y: auto;
        }
        .form-group.required .control-label:after {
            color: #d00;
            content: "*";
            position: absolute;
            margin-left: 8px;
            top:7px;
        }
    </style>
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <form class="form-inline">
            <div class="form-group">
                <input type="text" v-model="queryCondition.userName" @keyup.enter="query" class="form-control" placeholder="注册用户名称">
            </div>
            <div class="form-group">
                <input type="text" v-model="queryCondition.idNumber" @keyup.enter="query" class="form-control" placeholder="身份证号">
            </div>
            <div class="form-group">
                <input type="text" v-model="queryCondition.phone" @keyup.enter="query" class="form-control" placeholder="手机号">
            </div>

            <div class="form-group">
                <input type="text" v-model="queryCondition.imei" @keyup.enter="query" class="form-control" placeholder="IMIE号">
            </div>
            <div class="form-group">
                <input type="text" v-model="queryCondition.plateNumber" @keyup.enter="query" class="form-control" placeholder="车牌号">
            </div>
            <div class="form-group grid-btn">
                <a class="btn btn-default" @click="query">查询</a>
                <#if shiro.hasPermission("location:userregister:save")>
                    <a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
                </#if>
                <#if shiro.hasPermission("location:userregister:update")>
                    <a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
                </#if>
                <#if shiro.hasPermission("location:userregister:delete")>
                    <a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
                </#if>
            </div>
        </form>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

<!--             *******bootstrap panel 维护注册用户信息********         -->

    <div v-show="!showList" class="panel panel-primary" align="center">
        <div class="panel-heading">{{title}}</div>
        <form id="userRegisterForm" class="form-horizontal" style="width:100%!important;" role="form">
            <div class="form-group required">
                <label class="col-md-2 control-label">注册用户名称</label>
                <div class="col-md-3">
                    <input type="text" class="form-control input-sm" v-model="userRegister.userName" name="userName"
                           placeholder="注册用户名称"/>
                </div>
                <label class="col-md-2 control-label">手机号码</label>
                <div class="col-md-3">
                    <input type="text" class="form-control input-sm" v-model="userRegister.phone" name="phone"
                           placeholder="手机号码"/>
                </div>
            </div>
            <div class="form-group required">
                <label class="col-md-2 control-label">身份证号码</label>
                <div class="col-md-3">
                    <input type="text" class="form-control input-sm" v-model="userRegister.idNumber" name="idNumber"
                           placeholder="身份证号码"/>
                </div>
                <label class="col-md-2 control-label">身份证扫描件</label>
                <div class="col-md-3">
                    <input type="file" class="form-control input-sm" v-model="userRegister.idScanUrl" name="idScanUrl"
                           placeholder="身份证扫描件"/>
                </div>
            </div>
            <div class="form-group required">
                <label class="col-md-2 control-label">车牌号</label>
                <div class="col-md-3">
                    <input type="text" class="form-control input-sm" v-model="userRegister.plateNumber" name="plateNumber"
                           placeholder="车牌号"/>
                </div>
                <label class="col-md-2 control-label">车辆识别代码</label>
                <div class="col-md-3">
                    <input type="text" class="form-control input-sm" v-model="userRegister.vin" name="vin"
                           placeholder="车辆识别代码"/>
                </div>
            </div>
            <div class="form-group required">
                <label class="col-md-2 control-label">车辆颜色</label>
                <div class="col-md-3">
                    <input type="text" class="form-control input-sm" v-model="userRegister.vehicleColor" name="vehicleColor"
                           placeholder="车辆颜色"/>
                </div>
                <label class="col-md-2 control-label">所属职业</label>
                <div class="col-md-3">
                    <input type="text" class="form-control input-sm" v-model="userRegister.vocation" name="vocation"
                           placeholder="所属职业"/>
                </div>
            </div>
            <div class="form-group required">
                <label class="col-md-2 control-label">IMIE号</label>
                <div class="col-md-3">
                    <input type="text" class="form-control input-sm" v-model="userRegister.imei" name="imei"
                           placeholder="IMIE号"/>
                </div>
                <label class="col-md-2 control-label">行车记录仪型号</label>
                <div class="col-md-3">
                    <input type="text" class="form-control input-sm" v-model="userRegister.model" name="model"
                           placeholder="行车记录仪型号"/>
                </div>
            </div>
            <div class="form-group required">
                <label class="col-md-2 control-label">行车记录仪编号</label>
                <div class="col-md-3">
                    <input type="text" class="form-control input-sm" v-model="userRegister.reportNumber" name="reportNumber"
                           placeholder="行车记录仪编号"/>
                </div>
            </div>
            <div class="form-group required">
                <label class="col-md-2 control-label">银行卡号</label>
                <div class="col-md-3">
                    <input type="text" class="form-control input-sm" v-model="userRegister.bankCard" name="bankCard"
                           placeholder="银行卡号"/>
                </div>
                <label class="col-md-2 control-label">所属银行</label>
                <div class="col-md-3">
                    <input type="text" class="form-control input-sm" v-model="userRegister.bankName" name="bankName"
                           placeholder="所属银行"/>
                </div>
            </div>
            <div class="form-group required">
                <label class="col-md-2 control-label">银行卡扫描件</label>
                <div class="col-md-3">
                    <input type="file" class="form-control input-sm" v-model="userRegister.bankScanUrl" name="bankScanUrl"
                           placeholder="银行卡扫描件"/>
                </div>
                <label class="col-md-2 control-label">其他资料</label>
                <div class="col-md-3">
                    <input type="file" class="form-control input-sm" v-model="userRegister.otherDocument" name="otherDocument"
                           placeholder="其他资料"/>
                </div>
            </div>
            <input type="hidden" class="form-control input-sm" v-model="userRegister.id" name="id">
            <div class="form-group">
                <div class="form-group">
                    <div class="col-md-3 col-md-offset-4">
                    <input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
                    &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
                    </div>
                </div>
            </div>
        </form>

        <div class="row" style="display: none">
            <div class="col-sm-6 col-md-3">
                <div class="thumbnail">
                    <img :src="userRegister.idcardFilepath" style="width:320px;height: 300px;">
                    <div class="caption">
                        <h3>身份证扫描件</h3>
                    </div>
                </div>
            </div>
            <div class="col-sm-6 col-md-3">
                <div class="thumbnail">
                    <img :src="userRegister.bankFilePath" style="width:320px; height:300px;">
                    <div class="caption">
                        <h3>银行卡扫描件</h3>
                    </div>
                </div>
            </div>
            <div class="col-sm-6 col-md-3">
                <template v-if="userRegister.otherFilePath != undefined">
                <a href="#" class="thumbnail" @click="download" style="width:320px; height:300px;">
                    其他资料下载
                </a>
                </template>
            </div>
        </div>
    </div>
</div>

<script src="${request.contextPath}/statics/js/modules/location/userregister.js?_${.now?long}"></script>
<script src="${request.contextPath}/statics/js/modules/location/userregisterValidator.js?_${.now?long}"></script>
</body>
</html>